/*
 *      Created on: Mar 8, 2011
 *      Author: topcoder
 */
#include <LengthFormatter.h>

LengthFormatter::LengthFormatter(const Length &length, Format format)
:length_m(length), format_m(format)
{
}

ostream& operator<<(ostream& os, const LengthFormatter& lengthFormatter)
{
    if(lengthFormatter.format_m == FormatInBaseUnit)
    {
        (lengthFormatter.length_m).PrintInFormat2(os);
    }
    else if(lengthFormatter.format_m == FormatInUnitOrder)
    {
        (lengthFormatter.length_m).PrintInFormat1(os);
    }
    return os;
}


